package com.homework.HomeAcount.service;

import java.util.List;

import com.homework.HomeAcount.entity.Resource;
import com.homework.HomeAcount.entity.TreeNode;


public interface ResourceService {
	
	/**
	 * 获取资源顶级信息
	 * @return
	 */
	public List<TreeNode> getResourceTreeNodes();
	
	/**
	 * 根据上级资源主键获取子节点资源
	 * @param id
	 * @return
	 */
	public List<TreeNode> getSubResourceTreeNodes(String id);
	
	/**
	 * 根据主键获取资源信息
	 * @param id
	 * @return
	 */
	public Resource getResourceById(String id);
	
	/**
	 * 获取父节点资源
	 * @return
	 */
	public List<Resource> getParentResources();
	
	/**
	 * 根据主键更新资源信息
	 * @param resource
	 * @throws Exception
	 */
	public void updateResourceById(Resource resource) throws Exception;
	
	/**
	 * 新增资源信息
	 * @param resource
	 * @throws Exception
	 */
	public void insertResource(Resource resource) throws Exception;
	
}
